﻿@{
    ViewBag.Title = "Index";
}
<script src="~/Content/js/Hselect.js"></script>
@this.Partial("Index_js")

<div style="max-width:1000px;">
    <div class="topPanel">
        <div class="toolbar">
            <a class="a-btn-refresh" onclick="$ace.reload()"></a>
            <button class="a-btn-edit" data-bind="click:edit,disable:!dataTable.selectedModel()">修改</button>
            <button class="a-btn-add" data-bind="click:add">添加</button>
            <button class="a-btn-delete" data-bind="click:del,disable:!dataTable.selectedModel()">删除</button>
        </div>
        <div class="search">
            <table class="form-table" style="width:400px;">
                <tr>
                    <td> 
                        <input type="text" class="a-control" placeholder="请输入要查询关键字" style="width: 200px;" data-bind="value:searchModel().keyword">
                    </td>
                    <td>
                        <button type="button" class="a-btn-search" data-bind="click:search"></button>
                    </td>
                </tr>
            </table>
        </div>
    </div>


    <div>
        <table class="table table-hover" data-bind="with:dataTable">
            <thead>
                <tr>
                    <th style="width:20px;"></th>
                    <th>单号</th>
                    <th>发料</th>
                    <th>领料</th>
                    <th>审核</th>
                    <th>合计</th>
                    <th>入库时间</th>
                    <th>录入时间</th>
                </tr>
            </thead>
            <tbody data-bind="foreach:models">
                <tr data-bind="click:$parent.selectRow">
                    <td data-bind="text:$parent.getOrdinal($index())"></td>
                    <td>
                        <a data-bind="text:StockCode,attr:{href:'@Url.Content("~/Wiki/StockIn/Item?StockCode=")' + StockCode()}"></a>
                    </td>
                    <td data-bind="text:$ace.findName(_users,FromUserID(),'id','text')"></td>
                    <td data-bind="text:$ace.findName(_users,ToUserID(),'id','text')"></td>
                    <td data-bind="text:$ace.findName(_users,AuthUserID(),'id','text')"></td>
                    <td data-bind="text:Total"></td>
                    <td data-bind="dateString:ActionDate"></td>
                    <td data-bind="dateString:CreateDate"></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<dialogbox data-bind="with:dialog">
    <form id="form1">
        <table class="form-table">
            <tr>
                <td class="form-title">入库单号</td>
                <td class="form-value">
                    <input name="StockCode" type="text" class="a-control required" placeholder="请输入入库单号" data-bind="value:model().StockCode" />
                </td>
            </tr>
            <tr>
                <td class="form-title">合计</td>
                <td class="form-value">
                    <input name="Total" type="text" class="a-control required" placeholder="请输入合计" data-bind="value:model().Total" />
                </td>
            </tr>
            <tr>
                <td class="form-title">发料</td>
                <td class="form-value">
                    <select name="FromUserID" id="FromUserID" type="text" class="a-control required" data-bind="value:model().FromUserID"></select>
                </td>
            </tr>

            <tr>
                <td class="form-title">领料</td>
                <td class="form-value">
                    <select name="ToUserID" id="ToUserID" type="text" class="a-control required" data-bind="value:model().ToUserID"></select>
                </td>
            </tr>

            <tr>
                <td class="form-title">审核</td>
                <td class="form-value">
                    <select name="AuthUserID" id="AuthUserID" type="text" class="a-control required" data-bind="value:model().AuthUserID"></select>
                </td>
            </tr>

            <tr>
                <td class="form-title">入库时间</td>
                <td class="form-value">
                    <input name="ActionDate" id="ActionDate" type="text"  placeholder="请输入入库时间" class="a-control required Wdate" data-bind="dateString:model().ActionDate" />
                </td>
            </tr>

            <tr>
                <td class="form-title">录入时间</td>
                <td class="form-value">
                    <input name="CreateDate" id="CreateDate" type="text"  placeholder="请输入录入时间" class="a-control required Wdate" data-bind="dateString:model().CreateDate" />
                </td>
            </tr>

        </table>
    </form>
</dialogbox>
